//2009/08/20 23:14:45
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class ReversingBrackets
{
public:
    string removeBrackets(string s)
    {
		int pos1 = s.find('[');
		int pos2 = s.find(']');
		if(pos1 == -1 || pos2 == -1) return s;
		string ret = s.substr(0, pos1);
		for(int i=pos2-1; i>pos1; i--) ret += s[i];
		ret += s.substr(pos2 + 1);
		return ret;
    }
};
